1. Field of the Invention
The present invention relates to the following methods, devices, apparatuses, and systems:
(1) an encoding method of compressing/encoding recorded digital image data, such as caption data or simple animated cartoon data;
(2) a decoding method of decoding the compressed/encoded data;
(3) a compression/expansion system as a combination of the above encoding and decoding methods;
(4) a recording medium (two-sided or double-sided high-density optical disk) on which information is recorded by the above encoding method;
(5) a device (an integrated circuit or the like) for performing signal processing based on the encoding method;
(6) a device (an integrated circuit or the like) for performing signal processing based on the decoding method;
(7) a recording apparatus for recording various pieces of information on a recording medium by the encoding method;
(8) a playing back apparatus for playing back the information from the recording medium by the decoding method;
(9) a broadcasting/distributing system for broadcasting/distributing various pieces of information, which are compressed/encoded by the encoding method, by radio or wire; and
(10) an electronic mail system for exchanging various pieces of information, which are compressed/ encoded by the encoding method, by radio or via network lines (e.g., internet lines).
2. Description of the Related Art
As methods of compressing and recording or communicating image data, such as caption data, the following conventional methods are known.
The first method is a character code conversion method, in which text data is separated for every other word, and character codes corresponding to the respective words are recorded or communicated as data. Currently, as character codes, 2-byte codes used for Japanese and 1-byte codes used for English are widely used. As Japanese codes, JIS codes, shift JIS codes, and the like are used. As English codes, ASCII codes and the like are used.
In the first method, a character font ROM-corresponding to each character code set must be prepared in the image playing back apparatus. A character code which does not correspond to any one of the character font ROMs cannot be played back. For this reason, in order to allow the image playing back apparatus to handle a plurality of languages, a character font ROM is required for each language.
The second method is a method of reading test data as image data and encoding the data to compress the entire data. As a typical example of this encoding method, a run-length compression method is known.
In the run-length compression method, the length of continuous pixels of continuous identical data of pixel data obtained by scanning text data line by line is converted into a run-length code, and the resultant data is recorded or transmitted.
Consider a pixel data line like aaaabbbbbbbcccccdd". According to the run-length compression method, this data line is converted into data (run-length compressed code) like "a4, b7, c5, d2" consisting of pieces of pixel information (a, b, c, and d) and the numbers of pixels followed (4, 7, 5, and 2) indicating the numbers of pieces of pixel information.
As methods of further converting this run-length compressed code into a binary code, modified Huffman codings and arithmetic codings are known.
Modified Huffman codes (to be abbreviated to MH codes) used as standard codes in facsimile apparatuses will be briefly described first. Note that MH codes are used only when the contents of image information, i.e., pixels, have two colors, i.e., black and white.
A data file is converted into MH codes by using an algorithm which is designed such that a binary bit code having a small number of bits (i.e., a simple code) is assigned to data with a statistically high frequency of use (i.e., frequently used data), and a binary bit code having a large number of bits (i.e., a complicated code) is assigned to data with a low frequency of use (i.e., rarely used data) so as to reduce the total data amount of the data file.
In MH codings, as the number of types of data to be encoded increases, a corresponding code table increases in size. In addition, complicated code tables corresponding to the number of data to be encoded are required in both an encoder and a decoder.
For this reason, MH codings in a multilingual system handling various languages lead to great increases in the costs of both the encoder and the decoder.
Arithmetic codings will be described next.
In performing arithmetic codings, first, data is read, and the frequency of use of each data is checked. Codes having small numbers of bits are then assigned to the data in the order of decreasing frequencies of use so as to form a code table. The code table formed in this manner is recorded (or transmitted) as data. Thereafter, the data is encoded on the basis of this code table.
In arithmetic codings, although a code table must be recorded or transmitted, data can be formed by using a code table optimal for the contents of a file to be recorded or transmitted. In addition, in arithmetic codings, complicated code tables are not required in both an encoder and a decoder, unlike in MH codings.
In arithmetic codings, however, because a code table is formed in encoding data, the data must be read twice, and decoding processing is complicated.
U.S. Pat. No. 4,811,113 discloses an image encoding method that is different from the above two methods. In this method, a flag bit representing the number of bits as a code data length is prepared before a run-length code, and encoding and decoding are performed while an integer multiple of the value of the flag bit is regarded as a code data length.
In this method, since a data length is calculated from a flag bit, a large code table is not required, unlike in MH codings. However, the internal circuit arrangement of a decoder tends to be complicated because of the hardware for calculating a code data length.
In addition, in this method, although monochrome (black and white) data can be encoded/decoded as in MH codings, multi-color image data cannot be compressed without any improvement.